package patterns.singleton;

/**
 * Created by pc on 2015/5/6.
 */
public class DoubleCheckSingleton {
    private static DoubleCheckSingleton instance= null;
    private DoubleCheckSingleton(){}

    public static DoubleCheckSingleton getInstance(){
        if(instance==null){
            synchronized (DoubleCheckSingleton.class){
                if(instance==null) instance= new DoubleCheckSingleton();
            }
        }
        return instance;
    }

}
